<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">
<ui:define name="head">
    <script type="text/javascript" src="#{request.contextPath}/UI/support/pub.js"/>
    <script type="text/javascript" language="javascript">
        document.onkeydown = function TabReplace() {
            if (event.keyCode == 13) {
                if (event.srcElement.tagName != 'BUTTON')
                    event.keyCode = 9;
                else
                    event.srcElement.click();
            }
        }
    </script>
    <style type="text/css">
        .c_c {
            background: gray;
        }
    </style>
</ui:define>
<ui:define name="content">
<div style="margin:5px;">
<h:form id="form">
<p:growl id="msgs" showDetail="false"/>
<p:panel id="inputItemHieRelap" header="分包合同工程数量查询" style="width: 100%">
    <h:panelGrid columns="2" style="width: 100%">
        <h:panelGrid id="pgItemHieRelapInput" widgetVar="wvItemHieRelap"
                     columns="10" style="width: 100%">

            <h:outputLabel for="noItemHieRelap" value="编号:"/>
            <h:inputText id="noItemHieRelap"
                         value="#{itemHieRelapStlEngQAction.itemStlSubcttEngQMng.subctt_StrNo}"
                         style="font-weight:bold;background-color:gainsboro"
                         disabled="true">
            </h:inputText>

            <h:outputLabel for="name" value="名称:"/>
            <h:inputText id="name" value="#{itemHieRelapStlEngQAction.itemStlSubcttEngQMng.subctt_Name}"
                         style="font-weight:bold;background-color:gainsboro"
                         disabled="true"/>

            <h:outputLabel for="note" value="备注内容:"/>
            <h:inputTextarea id="note" value="#{itemHieRelapStlEngQAction.itemStlSubcttEngQMng.subctt_Note}"
                             rows="1" autoResize="false"
                             style="font-weight:bold;background-color:gainsboro"
                             disabled="true"/>

            <h:outputLabel for="unitItemInfo" value="单位:"/>
            <h:inputText id="unitItemInfo"
                         value="#{itemHieRelapStlEngQAction.itemStlSubcttEngQMng.subctt_Unit}"
                         style="font-weight:bold;background-color:gainsboro"
                         disabled="true"/>

            <h:outputLabel for="contractQuantityItemInfo" value="合同数量:"/>
            <h:inputText id="contractQuantityItemInfo"
                         value="#{itemHieRelapStlEngQAction.itemStlSubcttEngQMng.subctt_ContractQuantity}"
                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left;"
                         disabled="true">
                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
            </h:inputText>

            <h:outputLabel for="engQMng_BeginToCurrentPeriodEQty" value="开累工程数量:"/>
            <h:inputText id="engQMng_BeginToCurrentPeriodEQty"
                         value="#{itemHieRelapStlEngQAction.itemStlSubcttEngQMng.engQMng_BeginToCurrentPeriodEQty}"
                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left;"
                         disabled="true">
                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
            </h:inputText>

            <h:outputLabel for="engQMng_CurrentPeriodEQty" value="本期工程数量:"/>
            <h:inputText id="engQMng_CurrentPeriodEQty"
                         value="#{itemHieRelapStlEngQAction.itemStlSubcttEngQMng.engQMng_CurrentPeriodEQty}"
                         style="font-weight:bold;background-color:gainsboro;text-align:right;float:left;"
                         disabled="true">
                <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
            </h:inputText>
        </h:panelGrid>

    </h:panelGrid>
</p:panel>
<p:ajaxStatus style="width:16px;height:16px;">
    <f:facet name="start">
        <h:graphicImage value="/images/ajaxloading.gif"/>
    </f:facet>
    <f:facet name="complete">
        <h:outputText value=""/>
    </f:facet>
</p:ajaxStatus>
<p:dataTable id="ptt" style="width:100%;"
             value="#{itemHieRelapStlEngQAction.itemStlSubcttEngQMngList}"
             var="record"
             rowKey="#{record.subctt_Pkid}"
             selection="#{itemHieRelapStlEngQAction.itemStlSubcttEngQMngSelected}"
             selectionMode="single"
             paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink}
                                            {LastPageLink} {RowsPerPageDropdown}"
             paginator="true"
             paginatorPosition="bottom"
             rows="100"
             rowsPerPageTemplate="200,100,50,40,30,20,10"
             rowIndexVar="row"
             emptyMessage="数据记录为空..."
             widgetVar="dtItemDetail"
             rowStyleClass="#{record.subctt_SignPartAPrice eq 0? null :'c_c'}"
             stickyHeader="#{itemHieRelapStlEngQAction.strStickyHeaderFlag}">
    <!--rowStyleClass="#{record.subctt_ContractQuantity eq null? 'c_c':null}"-->
    <p:ajax event="rowSelect" listener="#{itemHieRelapStlEngQAction.onRowSelect}" update=":form:inputItemHieRelap"/>

    <!--<f:facet name="header">
        <span style="margin-left: -90%;">
            <p:commandButton id="downloadLink" value="列的显示控制" style="width:110px"
                             onclick ="wvColumnList.show()"
                             rendered="true">
            </p:commandButton>
        </span>
    </f:facet>-->

    <p:column headerText="序号"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('rowIndex').rendered_flag}">
        <h:outputText value="#{row + 1}"/>
    </p:column>

    <p:column style="width:100px" headerText="编号"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_StrNo').rendered_flag}">
        <h:outputText value="#{record.subctt_StrNo}" escape="false"/>
    </p:column>

    <p:column style="width:15px" headerText="层级"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_Grade').rendered_flag}">
        <h:outputText value="#{record.subctt_Grade}" escape="false"/>
        <!--<h:outputText value="&#8195;&#8195;ttt#{record.grade}"/>-->
    </p:column>

    <p:column style="width:15px" headerText="序号"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_Orderid').rendered_flag}">
        <h:outputText value="#{record.subctt_Orderid}" escape="false"/>
    </p:column>

    <p:column style="width:200px" headerText="名称"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_Name').rendered_flag}">
        <h:outputText value="#{record.subctt_Name}"/>
    </p:column>

    <p:column style="width:30px" headerText="单位"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_Unit').rendered_flag}">
        <h:outputText value="#{record.subctt_Unit}" style="text-align:right"/>
    </p:column>

    <p:column style="width:80px" headerText="合同单价"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_ContractUnitPrice').rendered_flag}">
        <h:outputText value="#{record.subctt_ContractUnitPrice}" style="float: right">
            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
        </h:outputText>
    </p:column>

    <p:column style="width:80px" headerText="合同数量"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_ContractQuantity').rendered_flag}">
        <h:outputText value="#{record.subctt_ContractQuantity}" style="float: right">
            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
        </h:outputText>
    </p:column>

    <p:column style="width:80px" headerText="合同金额"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_ContractAmount').rendered_flag}">
        <h:outputText value="#{record.subctt_ContractAmount}" style="float: right">
            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
        </h:outputText>
    </p:column>

    <p:column headerText="其中：甲供材单价"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_SignPartAPrice').rendered_flag}">
        <h:outputText value="#{record.subctt_SignPartAPrice}" style="float: right">
            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
        </h:outputText>
    </p:column>

    <p:column headerText="备注内容"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_Note').rendered_flag}">
        <h:outputText value="#{record.subctt_Note}"/>
    </p:column>

    <p:column style="width:80px" headerText="项号"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_Pkid').rendered_flag}">
        <h:outputText value="#{record.subctt_Pkid}"/>
    </p:column>

    <p:column style="width:100px" headerText="Item项标志"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('subctt_ItemPkid').rendered_flag}">
        <h:outputText value="#{record.subctt_ItemPkid}"/>
    </p:column>


    <p:column style="width:100px" headerText="工程数量项Pkid"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_Pkid').rendered_flag}">
        <h:outputText value="#{record.engQMng_Pkid}"/>
    </p:column>

    <!-- <p:column headerText="期"
               rendered="#{stlSubCttEngQMngAction .columnModelSelectedMap.get('engQMng_PeriodNo').rendered_flag}">
         <h:outputText value="#{record.engQMng_PeriodNo}" />
     </p:column>-->

    <p:column headerText="分包合同PKID"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_SubcttPkid').rendered_flag}">
        <h:outputText value="#{record.engQMng_SubcttPkid}"/>
    </p:column>

    <p:column headerText="对应分包合同项PKID"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_ItemPkid').rendered_flag}">
        <h:outputText value="#{record.engQMng_ItemPkid}"/>
    </p:column>

    <p:column headerText="开累工程数量"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_BeginToCurrentPeriodEQty').rendered_flag}">
        <h:outputText value="#{record.engQMng_BeginToCurrentPeriodEQty}" style="float: right">
            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
        </h:outputText>
    </p:column>

    <p:column headerText="当期工程数量"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_CurrentPeriodEQty').rendered_flag}">
        <h:outputText value="#{record.engQMng_CurrentPeriodEQty}" style="float: right">
            <f:convertNumber type="number" pattern="#,###,###,###,##0.00"/>
        </h:outputText>
    </p:column>

    <p:column headerText="状态标志"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_State').rendered_flag}">
        <h:outputText value="#{record.engQMng_State}"/>
    </p:column>

    <p:column headerText="记录删除标志"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_DeletedFlag').rendered_flag}">
        <h:outputText value="#{record.engQMng_DeletedFlag}"/>
    </p:column>

    <p:column headerText="数据来源的标志"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_OriginFlag').rendered_flag}">
        <h:outputText value="#{record.engQMng_OriginFlag}"/>
    </p:column>

    <p:column headerText="记录创建人"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_CreatedBy').rendered_flag}">
        <h:outputText value="#{record.engQMng_CreatedBy}"/>
    </p:column>

    <p:column headerText="记录创建时间"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_CreatedDate').rendered_flag}">
        <h:outputText value="#{record.engQMng_CreatedDate}"/>
    </p:column>

    <p:column headerText="记录最近修改人"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_LastUpdBy').rendered_flag}">
        <h:outputText value="#{record.engQMng_LastUpdBy}"/>
    </p:column>

    <p:column headerText="记录最近修改时间"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_LastUpdDate').rendered_flag}">
        <h:outputText value="#{record.engQMng_LastUpdDate}"/>
    </p:column>

    <p:column headerText="记录修改次数"
              rendered="#{itemHieRelapStlEngQAction .columnModelSelectedMap.get('engQMng_ModificationNum').rendered_flag}">
        <h:outputText value="#{record.engQMng_ModificationNum}"/>
    </p:column>

    <!-- <p:columnGroup type="footer">
        <p:row>
            <p:column footerText="总计: "
                      style="text-align:right" colspan="2" />
            <p:column footerText="#{stlSubCttEngQMngAction.totalCurrentPeriodEQty}"
                      style="text-align:right"
                      colspan="#{stlSubCttEngQMngAction.totalAmountColspan}">
            </p:column>
        </p:row>
     </p:columnGroup>-->
    <p:columns value="#{itemHieRelapStlEngQAction.columnModelPeriodList}" var="column" columnIndexVar="colIndex">
        <f:facet name="header">
            #{column.column_name}
        </f:facet>

        #{column.comments}
    </p:columns>

</p:dataTable>
<p:dialog id="dLColumnList" widgetVar="wvColumnList" header="列的显示控制">
    <p:dataTable id="pdtColumnList"
                 value="#{itemHieRelapStlEngQAction.columnModelList}"
                 var="recordColumn"
                 dynamic="true"
                 rowKey="#{recordColumn.column_name}"
                 selection="#{itemHieRelapStlEngQAction.columnModelSelectedList}"
                 paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
                 paginator="true"
                 paginatorPosition="bottom"
                 rows="15"
                 rowsPerPageTemplate="100,50,30,15,5"
                 emptyMessage="数据记录为空...">
        <!--value="#{esCommonAction.getColumnNameByTableName(stlSubCttEngQMngAction.strTableName)}"-->
        <!--selectionMode="multiple"可多选，但是没有多选的CheckBox-->

        <p:column selectionMode="multiple"/>

        <p:column headerText="列号" rendered="false">
            <h:outputText value="#{recordColumn.column_name}"/>
        </p:column>

        <p:column headerText="列名" style="text-align:left">
            <h:outputText value="#{recordColumn.comments}"/>
        </p:column>

        <p:column headerText="选中" style="text-align:left" rendered="false">
            <h:outputText value="#{recordColumn.rendered_flag}"/>
        </p:column>

        <f:facet name="footer">
            <p:commandButton id="multiSubmitBtn" value="提交"
                             action="#{itemHieRelapStlEngQAction.setColumnsSubmitAction}"
                             update=":form:ptt" oncomplete="wvColumnList.hide()"/>
        </f:facet>
    </p:dataTable>
</p:dialog>
</h:form>
</div>
</ui:define>
</ui:composition>